package com.ruoyi.chat.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;

/**
 * 聊天信息存储对象 chat_message
 * 
 * @author zhc
 * @date 2025-05-31
 */
public class ChatMessage extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** $column.columnComment */
    private String id;

    /** 发送者的用户id */
    @Excel(name = "发送者的用户id")
    private String senderId;

    /** 接受者的用户id */
    @Excel(name = "接受者的用户id")
    private String receiverId;

    /** 消息接受者的类型，可以作为扩展字段 */
    @Excel(name = "消息接受者的类型，可以作为扩展字段")
    private Long receiverType;

    /** 聊天内容 */
    @Excel(name = "聊天内容")
    private String msg;

    /** 消息类型，有文字类、图片类、视频类...等，详见枚举类 */
    @Excel(name = "消息类型，有文字类、图片类、视频类...等，详见枚举类")
    private Long msgType;

    /** 消息的聊天时间，既是发送者的发送时间、又是接受者的接受时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "消息的聊天时间，既是发送者的发送时间、又是接受者的接受时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date chatTime;

    /** 标记存储数据库，用于历史展示。每超过1分钟，则显示聊天时间，前端可以控制时间长短(扩展字段) */
    @Excel(name = "标记存储数据库，用于历史展示。每超过1分钟，则显示聊天时间，前端可以控制时间长短(扩展字段)")
    private Long showMsgDateTimeFlag;

    /** 视频地址 */
    @Excel(name = "视频地址")
    private String videoPath;

    /** 视频宽度 */
    @Excel(name = "视频宽度")
    private Long videoWidth;

    /** 视频高度 */
    @Excel(name = "视频高度")
    private Long videoHeight;

    /** 视频时间 */
    @Excel(name = "视频时间")
    private Long videoTimes;

    /** 语音地址 */
    @Excel(name = "语音地址")
    private String voicePath;

    /** 语音时长 */
    @Excel(name = "语音时长")
    private Long speakVoiceDuration;

    /** 语音消息标记是否已读未读，true: 已读，false: 未读 */
    @Excel(name = "语音消息标记是否已读未读，true: 已读，false: 未读")
    private Integer isRead;

    public void setId(String id) 
    {
        this.id = id;
    }

    public String getId() 
    {
        return id;
    }

    public void setSenderId(String senderId) 
    {
        this.senderId = senderId;
    }

    public String getSenderId() 
    {
        return senderId;
    }

    public void setReceiverId(String receiverId) 
    {
        this.receiverId = receiverId;
    }

    public String getReceiverId() 
    {
        return receiverId;
    }

    public void setReceiverType(Long receiverType) 
    {
        this.receiverType = receiverType;
    }

    public Long getReceiverType() 
    {
        return receiverType;
    }

    public void setMsg(String msg) 
    {
        this.msg = msg;
    }

    public String getMsg() 
    {
        return msg;
    }

    public void setMsgType(Long msgType) 
    {
        this.msgType = msgType;
    }

    public Long getMsgType() 
    {
        return msgType;
    }

    public void setChatTime(Date chatTime) 
    {
        this.chatTime = chatTime;
    }

    public Date getChatTime() 
    {
        return chatTime;
    }

    public void setShowMsgDateTimeFlag(Long showMsgDateTimeFlag) 
    {
        this.showMsgDateTimeFlag = showMsgDateTimeFlag;
    }

    public Long getShowMsgDateTimeFlag() 
    {
        return showMsgDateTimeFlag;
    }

    public void setVideoPath(String videoPath) 
    {
        this.videoPath = videoPath;
    }

    public String getVideoPath() 
    {
        return videoPath;
    }

    public void setVideoWidth(Long videoWidth) 
    {
        this.videoWidth = videoWidth;
    }

    public Long getVideoWidth() 
    {
        return videoWidth;
    }

    public void setVideoHeight(Long videoHeight) 
    {
        this.videoHeight = videoHeight;
    }

    public Long getVideoHeight() 
    {
        return videoHeight;
    }

    public void setVideoTimes(Long videoTimes) 
    {
        this.videoTimes = videoTimes;
    }

    public Long getVideoTimes() 
    {
        return videoTimes;
    }

    public void setVoicePath(String voicePath) 
    {
        this.voicePath = voicePath;
    }

    public String getVoicePath() 
    {
        return voicePath;
    }

    public void setSpeakVoiceDuration(Long speakVoiceDuration) 
    {
        this.speakVoiceDuration = speakVoiceDuration;
    }

    public Long getSpeakVoiceDuration() 
    {
        return speakVoiceDuration;
    }

    public void setIsRead(Integer isRead) 
    {
        this.isRead = isRead;
    }

    public Integer getIsRead() 
    {
        return isRead;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("senderId", getSenderId())
            .append("receiverId", getReceiverId())
            .append("receiverType", getReceiverType())
            .append("msg", getMsg())
            .append("msgType", getMsgType())
            .append("chatTime", getChatTime())
            .append("showMsgDateTimeFlag", getShowMsgDateTimeFlag())
            .append("videoPath", getVideoPath())
            .append("videoWidth", getVideoWidth())
            .append("videoHeight", getVideoHeight())
            .append("videoTimes", getVideoTimes())
            .append("voicePath", getVoicePath())
            .append("speakVoiceDuration", getSpeakVoiceDuration())
            .append("isRead", getIsRead())
            .toString();
    }
}
